<?php

/**
*	伪删除用户信息(逻辑删除)
*
*/

//包含公共文件
include '../../common/common.php';

//获取get传值
// var_dump($_POST);
$arrUser = $_POST['arrUser'];
$strUser = join(',' , $arrUser);
// var_dump($arrUser);
// var_dump($strUser);

//判断选项是否为空
if (!$arrUser) {

	exit('选项不得为空');
}

// 修改数据库 (伪删除)
$resUser = myUpdate($link , DB_TABLE_USER , ['uisdel' => 1] , "uid in ($strUser)");
$userPost = myUpdate($link , DB_TABLE_DETAIL , ['isdel' => 1 , 'userdel' => '1'] , "authorid in ($strUser)");
// var_dump($resUser);
// var_dump($userPost);

if (!$resUser) {

	exit('删除失败,放入回收站失败<br /> <a href="'  . $_SERVER['HTTP_REFERER'] .'">返回上一页</a>');
}

//页面跳转
echo '删除成功,已放入回收站';
//跳转页面
header('refresh:1;url=' . $_SERVER['HTTP_REFERER']);

